﻿<UserControl x:Class="Spenta.StreetCare.Silverlight.UserControls.FilterByCategoryUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ViewModels="clr-namespace:Spenta.StreetCare.Silverlight.MVVM.ViewModels" xmlns:UserControls="clr-namespace:Spenta.StreetCare.Silverlight.UserControls" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="252">
    
    <UserControl.Resources>
        <ViewModels:CategoriesViewModel x:Key="CategoriesViewModel" />
    </UserControl.Resources>
    
    <ItemsControl Width="252" DataContext="{StaticResource CategoriesViewModel}" d:DataContext="{d:DesignData /SampleData/CategoriesViewModelSampleData.xaml}" ItemsSource="{Binding CategoriesWithCount}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Grid Margin="0" Style="{StaticResource FilterToolBarGrid}">
                	<StackPanel Margin="0,0,0,8" Orientation="Horizontal">
                		<UserControls:WaitUserControl Foreground="Orange" IsMoving="{Binding IsDirty}" Padding="0,0,10,0" Margin="5,0,10,0" />
                		<Border HorizontalAlignment="Center" Height="15" Margin="0,3,8,0" VerticalAlignment="Top" Width="15" CornerRadius="3" Background="{Binding CategoryColor, Converter={StaticResource PushpinTypeBrushConverter}}" >
                			<Image Source="{Binding CategoryImageUrl}" />
                		</Border>
                		<StackPanel>
                			<HyperlinkButton  Command="{Binding FilterByCategoryCommand, Source={StaticResource CategoriesViewModel}}" CommandParameter="{Binding CategoryID}" Content="{Binding CategoryTitle}" Style="{StaticResource ToolbarLinkLabel}" />
                			<StackPanel Orientation="Horizontal">
                				<dataInput:Label Content="{Binding ReportCount}" Style="{StaticResource ToolbarLinkCaption}" />
                				<dataInput:Label Margin="5,0,0,0" Content="{Binding Literals.Reports, Source={StaticResource CategoriesViewModel}}" Style="{StaticResource ToolbarLinkCaption}" />
                			</StackPanel>
                		</StackPanel>
                	</StackPanel>
                </Grid>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</UserControl>
